package com.wxy.demo.design_pattern.simple_factory;

/**
 * <p>
 * 工厂模式
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2022/11/3 13:13
 */
public class Demo {
    public static void main(String[] args) {
        ShapeFactory factory = new ShapeFactory();

        Shape circle = factory.getShape("circle");
        circle.draw();

        Shape rectangle = factory.getShape("rectangle");
        rectangle.draw();

        Shape square = factory.getShape("square");
        square.draw();
    }
}
